home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / b / b.lha / B / src / bint / b1tlt.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-11-24  |  1.6 KB  |  48 lines

  1. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  2.  
  3. /*
  4.   $Header: b1tlt.h,v 1.4 85/08/22 16:42:12 timo Exp $
  5. */
  6.  
  7. #ifndef INTEGRATION
  8.  
  9. /* Private definitions for B texts, lists and tables */
  10.  
  11. typedef struct telita {
  12.     HEADER; btreeptr root;
  13. } a_telita, *telita;
  14.  
  15. #define Itemtype(v) (((telita) (v))->len) /* Itemtype */
  16. #define Root(v) (((telita) (v))->root)
  17. #define Tltsize(v) (Root(v) EQ Bnil ? 0 : Size(Root(v)))
  18.  
  19. #define Character(v)    ((bool) (Type(v) EQ Tex && Tltsize(v) EQ 1))
  20. value mkchar();     /* char c */
  21.  
  22. #else INTEGRATION
  23.  
  24. /************************************************************************/
  25. /* Private definitions for small texts, lists and tables module         */
  26. /* A text is modelled as a sequence of len characters.                  */
  27. /*                                                                      */
  28. /* A list is modelled as a sequence of len values,                      */
  29. /*         each of which corresponds to a list entry.                   */
  30. /*                                                                      */
  31. /* A table is modelled as a sequence of len values,                     */
  32. /*         each of which corresponds to a table entry;                  */
  33. /*     table entries are modelled as a compound with two fields.        */
  34. /************************************************************************/
  35.  
  36. #define Cts(v) (*Ats(v))
  37. #define Dts(v) (*(Ats(v)+1))
  38.  
  39. #define List_elem(l, i) (*(Ats(l)+i)) /*counts from 0; takes no copy*/
  40. #define Key(t, i) (Ats(*(Ats(t)+i))) /*Ditto*/
  41. #define Assoc(t, i) (Ats(*(Ats(t)+i))+1) /*Ditto*/
  42.  
  43. bool found();
  44. value list_elem();
  45. value key_elem();
  46.  
  47. #endif INTEGRATION
  48.